home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / snip9_91.arc / MOUSE2.C < prev    next >
C/C++ Source or Header  |  1991-09-17  |  1KB  |  87 lines

  1. /*    module:        mouse.c
  2.  *    programmer:    Ray L. McVay
  3.  *    started:    26oct86
  4.  *    updated:    26oct86
  5.  *
  6.  *    Some handy mouse interface functions.
  7.  */
  8.  
  9. #include <stdio.h>
  10. #include <dos.h>
  11.  
  12. static union REGS reg;
  13. static struct SREGS sreg;
  14.  
  15.  
  16. int mstatus(void)
  17. {
  18.     reg.x.ax = 0;
  19.     int86(0x33, ®, ®);
  20.     if (reg.x.ax == 0xffff)
  21.         return(reg.x.bx);
  22.     else
  23.         return(0);
  24. }
  25.  
  26.  
  27. void mshow(void)
  28. {
  29.     reg.x.ax = 1;
  30.     int86(0x33, ®, ®);
  31. }
  32.  
  33.  
  34. void mhide(void)
  35. {
  36.     reg.x.ax = 2;
  37.     int86(0x33, ®, ®);
  38. }
  39.  
  40.  
  41. void mpos(int *mbt, int *mx, int *my)
  42. {
  43.     reg.x.ax = 3;
  44.     int86(0x33, ®, ®);
  45.     *mbt = reg.x.bx;
  46.     *mx = reg.x.cx;
  47.     *my = reg.x.dx;
  48. }
  49.  
  50.  
  51. void mput(int mx, int my)
  52. {
  53.     reg.x.ax = 4;
  54.     reg.x.cx = mx;
  55.     reg.x.dx = my;
  56.     int86(0x33, ®, ®);
  57. }
  58.  
  59.  
  60. void mhlimit(int hmin, int hmax)
  61. {
  62.     reg.x.ax = 7;
  63.     reg.x.cx = hmin;
  64.     reg.x.dx = hmax;
  65.     int86(0x33, ®, ®);
  66. }
  67.  
  68.  
  69. void mvlimit(int vmin, int vmax)
  70. {
  71.     reg.x.ax = 8;
  72.     reg.x.cx = vmin;
  73.     reg.x.dx = vmax;
  74.     int86(0x33, ®, ®);
  75. }
  76.  
  77.  
  78. void mshape(int xhot, int yhot, int far shape[]) /* shape[32] */
  79. {
  80.     reg.x.ax = 9;
  81.     reg.x.bx = xhot;
  82.     reg.x.cx = yhot;
  83.     reg.x.dx = FP_OFF(shape);
  84.     sreg.es = FP_SEG(shape);
  85.     int86x(0x33, ®, ®, &sreg);
  86. }
  87.